import { BasicColumn, FormSchema } from '/@/components/Table';
// 表格字段
export const columns: BasicColumn[] = [
  {
    title: '城市',
    dataIndex: 'city',
  },
  {
    title: '状态',
    dataIndex: 'isUse',
    slots: { customRender: 'isUse' },
  },
  {
    title: '操作',
    dataIndex: 'action',
    slots: { customRender: 'action' },
    width: 110,
  },
];
// 表单
export const searchFormSchema: FormSchema[] = [
  {
    field: 'area',
    label: '城市',
    component: 'Input',
    colProps: { span: 6 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'status',
    label: '状态',
    component: 'Select',
    componentProps: {
      placeholder: '请选择',
      options: [
        { label: '已启用', value: '已启用' },
        { label: '已禁用', value: '已禁用' },
      ],
    },
    colProps: { span: 6 },
  },
];

// 表格数据
export const dataSource = [
  {
    id: 1,
    buildingName: 'LIC',
    area: '大纽约地区',
    status: '已启用',
    seoTitle: 'seo标题',
    seoDesc: 'seo描述',
    seoKeyWord: 'seo关键字',
    seoUrl: 'seo-URL',
    pic: 'pic-URL',
    remark: '简介',
  },
  {
    id: 2,
    buildingName: 'manhatton downtown',
    area: '大纽约地区',
    status: '已禁用',
    seoTitle: 'seo标题',
    seoDesc: 'seo描述',
    seoKeyWord: 'seo关键字',
    seoUrl: 'seo-URL',
    pic: 'pic-URL',
    remark: '简介',
  },
];

export const getAccountList = () => {
  return dataSource;
};

export const buildingFormSchema: FormSchema[] = [
  {
    field: 'area',
    label: '城市',
    component: 'Input',
    componentProps: {
      placeholder: '请输入',
    },
    dynamicRules: () => {
      return [
        {
          required: true,
          message: '请输入城市',
        },
      ];
    },
  },
  {
    field: 'EName',
    label: '城市英文缩写',
    component: 'Input',
    componentProps: {
      placeholder: '请输入',
    },
    dynamicRules: () => {
      return [
        {
          required: true,
          message: '请输入城市英文缩写',
        },
      ];
    },
  },
  {
    label: '学校',
    field: 'school',
    component: 'Input',
    slot: 'schoolSlot',
  },
  {
    label: '社区',
    field: 'community',
    component: 'Upload',
    slot: 'communitySlot',
  },
];
